package game.constants;

import java.awt.image.BufferedImage;
import java.io.IOException;

import javax.imageio.ImageIO;

public class ImagesSingleton {
  public static BufferedImage images[];
  public static BufferedImage imagesCollision[];
  public static BufferedImage imagesMini[];

  static {
    images = new BufferedImage[100];
    imagesCollision = new BufferedImage[100];
    imagesMini = new BufferedImage[100];
    try {
      loadImages();
      loadImagesCollision();
      loadImagesMini();

    } catch (IOException e) {
      e.printStackTrace();
    }
  }

  private static void loadImages() throws IOException {
    images[ReferenceObject.OBJECT_REFERENCE_PLAYER] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/hongo.gif"));
    images[ReferenceObject.OBJECT_REFERENCE_POTION] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/potion.gif"));
    images[ReferenceObject.OBJECT_REFERENCE_MONSTER_1] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/monster.gif"));
    images[ReferenceObject.OBJECT_REFERENCE_BACKGROUND_1] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/background_1.gif"));
    images[ReferenceObject.OBJECT_REFERENCE_BACKGROUND_2] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/mosaico1.gif"));
    //images [ReferenceObject.OBJECT_REFERENCE_BACKGROUND_2] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/mosaico1.gif"));
    images[ReferenceObject.OBJECT_REFERENCE_BONES] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/huesos.gif"));
    images[ReferenceObject.OBJECT_REFERENCE_FLOWER] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/flor.gif"));
    images[ReferenceObject.OBJECT_REFERENCE_AXE] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/hacha.gif"));
    images[ReferenceObject.OBJECT_REFERENCE_TREE] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/arbol.gif"));
    images[ReferenceObject.OBJECT_REFERENCE_TRUNK] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/tronco.gif"));
    images[ReferenceObject.OBJECT_REFERENCE_DOG] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/perro.gif"));

    //		images [ReferenceObject.OBJECT_REFERENCE_ACADEMY1] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/academy1.gif"));
    //		images [ReferenceObject.OBJECT_REFERENCE_ACADEMY2] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/academy2.gif"));
    //		
    //		images [ReferenceObject.OBJECT_REFERENCE_BARRACK1] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/barrack1.gif"));
    //		images [ReferenceObject.OBJECT_REFERENCE_BARRACK2] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/barrack2.gif"));
    //		
    //		images [ReferenceObject.OBJECT_REFERENCE_COMMAND_CENTER1] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/commandCenter1.gif"));
    //		images [ReferenceObject.OBJECT_REFERENCE_COMMAND_CENTER2] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/commandCenter2.gif"));
    //		
    //		images [ReferenceObject.OBJECT_REFERENCE_MINERALS] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/minerals.gif"));
    //		images [ReferenceObject.OBJECT_REFERENCE_VESPENE_GAS] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/vespene_gas.gif"));
    //		
    //		images [ReferenceObject.OBJECT_REFERENCE_SVC1] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/scv1.gif"));
    //		images [ReferenceObject.OBJECT_REFERENCE_SVC2] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/scv2.gif"));
    //		
    //		images [ReferenceObject.OBJECT_REFERENCE_MARINE1] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/marine1.gif"));
    //		images [ReferenceObject.OBJECT_REFERENCE_MARINE2] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/marine1.gif"));
    //		
    //		images [ReferenceObject.OBJECT_REFERENCE_FIREBAT1] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/firebat1.gif"));
    //		images [ReferenceObject.OBJECT_REFERENCE_FIREBAT2] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/firebat1.gif"));
    //		
    //		images [ReferenceObject.OBJECT_REFERENCE_REFINERY1] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/refinery.gif"));
    //		images [ReferenceObject.OBJECT_REFERENCE_BACKGROUND_3] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/background3.gif"));

    images[ReferenceObject.OBJECT_REFERENCE_LAND] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/land.gif"));
    images[ReferenceObject.OBJECT_REFERENCE_TREE1] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/arbol1.gif"));
    images[ReferenceObject.OBJECT_REFERENCE_STONE] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/piedra.gif"));
    images[ReferenceObject.OBJECT_REFERENCE_HOUSE1] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/casa.gif"));
    images[ReferenceObject.OBJECT_REFERENCE_TRASNPORT] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/transportador.gif"));
    images[ReferenceObject.OBJECT_REFERENCE_TRASNPORT1] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/transportador.gif"));

    images[ReferenceObject.OBJECT_REFERENCE_TABLE] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/mesa.gif"));
    images[ReferenceObject.OBJECT_REFERENCE_SWORD] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/espada.gif"));

    //		images [ReferenceObject.OBJECT_REFERENCE_BONES1] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/esqueleto1.gif"));
    images[ReferenceObject.OBJECT_REFERENCE_RAT] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/raton.gif"));

    images[ReferenceObject.OBJECT_REFERENCE_STATUE] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/estatua.gif"));

  }

  private static void loadImagesCollision() throws IOException {

    imagesCollision[ReferenceObject.OBJECT_REFERENCE_PLAYER] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/hongo.gif"));
    imagesCollision[ReferenceObject.OBJECT_REFERENCE_POTION] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/potionCollision.gif"));
    imagesCollision[ReferenceObject.OBJECT_REFERENCE_MONSTER_1] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/monster.gif"));
    imagesCollision[ReferenceObject.OBJECT_REFERENCE_BONES] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/huesos.gif"));
    imagesCollision[ReferenceObject.OBJECT_REFERENCE_FLOWER] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/flor.gif"));
    imagesCollision[ReferenceObject.OBJECT_REFERENCE_AXE] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/hacha.gif"));
    imagesCollision[ReferenceObject.OBJECT_REFERENCE_TREE] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/arbolCollision.gif"));
    imagesCollision[ReferenceObject.OBJECT_REFERENCE_TRUNK] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/tronco.gif"));
    imagesCollision[ReferenceObject.OBJECT_REFERENCE_DOG] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/perro.gif"));

    //		imagesCollision [ReferenceObject.OBJECT_REFERENCE_ACADEMY1] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/academy1Collision.gif"));
    //		imagesCollision [ReferenceObject.OBJECT_REFERENCE_ACADEMY2] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/academy2.gif"));
    //		
    //		imagesCollision [ReferenceObject.OBJECT_REFERENCE_BARRACK1] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/barrack1Collision.gif"));
    //		imagesCollision [ReferenceObject.OBJECT_REFERENCE_BARRACK2] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/barrack2.gif"));
    //		
    //		imagesCollision [ReferenceObject.OBJECT_REFERENCE_COMMAND_CENTER1] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/commandCenter1Collision.gif"));
    //		imagesCollision [ReferenceObject.OBJECT_REFERENCE_COMMAND_CENTER2] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/commandCenter2.gif"));

    //		imagesCollision [ReferenceObject.OBJECT_REFERENCE_MINERALS] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/minerals.gif"));
    //		imagesCollision [ReferenceObject.OBJECT_REFERENCE_VESPENE_GAS] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/vespene_gas.gif"));
    //		
    //		imagesCollision [ReferenceObject.OBJECT_REFERENCE_SVC1] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/scv1.gif"));
    //		imagesCollision [ReferenceObject.OBJECT_REFERENCE_SVC2] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/scv2.gif"));
    //		
    //		imagesCollision [ReferenceObject.OBJECT_REFERENCE_MARINE1] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/marine1.gif"));
    //		imagesCollision [ReferenceObject.OBJECT_REFERENCE_MARINE2] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/marine1.gif"));
    //		
    //		imagesCollision [ReferenceObject.OBJECT_REFERENCE_FIREBAT1] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/firebat1.gif"));
    //		imagesCollision [ReferenceObject.OBJECT_REFERENCE_FIREBAT2] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/firebat1.gif"));
    //		
    //		imagesCollision [ReferenceObject.OBJECT_REFERENCE_REFINERY1] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/refineryCollision.gif"));

    imagesCollision[ReferenceObject.OBJECT_REFERENCE_LAND] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/land.gif"));
    imagesCollision[ReferenceObject.OBJECT_REFERENCE_TREE1] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/arbol1Collision.gif"));
    imagesCollision[ReferenceObject.OBJECT_REFERENCE_STONE] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/piedraCollision.gif"));
    imagesCollision[ReferenceObject.OBJECT_REFERENCE_HOUSE1] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/casaCollision.gif"));
    imagesCollision[ReferenceObject.OBJECT_REFERENCE_TRASNPORT] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/transportador.gif"));
    imagesCollision[ReferenceObject.OBJECT_REFERENCE_TRASNPORT1] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/transportador.gif"));

    imagesCollision[ReferenceObject.OBJECT_REFERENCE_TABLE] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/mesaCollision.gif"));
    imagesCollision[ReferenceObject.OBJECT_REFERENCE_SWORD] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/espada.gif"));

    //		imagesCollision [ReferenceObject.OBJECT_REFERENCE_BONES1] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/esqueleto1Collision.gif"));
    //		imagesCollision [ReferenceObject.OBJECT_REFERENCE_RAT] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/raton.gif"));
    imagesCollision[ReferenceObject.OBJECT_REFERENCE_RAT] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/raton.gif"));
  }

  private static void loadImagesMini() throws IOException {
    imagesMini[ReferenceObject.OBJECT_REFERENCE_PLAYER] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/hongo.gif"));
    imagesMini[ReferenceObject.OBJECT_REFERENCE_POTION] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/potionMini.gif"));
    imagesMini[ReferenceObject.OBJECT_REFERENCE_MONSTER_1] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/monster.gif"));
    imagesMini[ReferenceObject.OBJECT_REFERENCE_BONES] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/huesos.gif"));
    imagesMini[ReferenceObject.OBJECT_REFERENCE_FLOWER] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/flor.gif"));
    imagesMini[ReferenceObject.OBJECT_REFERENCE_AXE] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/hacha.gif"));
    imagesMini[ReferenceObject.OBJECT_REFERENCE_TREE] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/arbol.gif"));
    imagesMini[ReferenceObject.OBJECT_REFERENCE_TRUNK] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/tronco.gif"));
    imagesMini[ReferenceObject.OBJECT_REFERENCE_DOG] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/perro.gif"));
    //    imagesMini[ReferenceObject.OBJECT_REFERENCE_RAT] = ImageIO.read(new File(
    //        "C:/JavaEclipse/Tesis/StarcraftTryGame/images/collision/raton.gif"));

    imagesMini[ReferenceObject.OBJECT_REFERENCE_RAT] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/raton.gif"));

    //		imagesMini [ReferenceObject.OBJECT_REFERENCE_ACADEMY1] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/academy1.gif"));
    //		imagesMini [ReferenceObject.OBJECT_REFERENCE_ACADEMY2] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/academy2.gif"));
    //		
    //		imagesMini [ReferenceObject.OBJECT_REFERENCE_BARRACK1] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/barrack1.gif"));
    //		imagesMini [ReferenceObject.OBJECT_REFERENCE_BARRACK2] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/barrack2.gif"));
    //		
    //		imagesMini [ReferenceObject.OBJECT_REFERENCE_COMMAND_CENTER1] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/commandCenter1.gif"));
    //		imagesMini [ReferenceObject.OBJECT_REFERENCE_COMMAND_CENTER2] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/commandCenter2.gif"));

    //		imagesMini [ReferenceObject.OBJECT_REFERENCE_MINERALS] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/minerals.gif"));
    //		imagesMini [ReferenceObject.OBJECT_REFERENCE_VESPENE_GAS] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/vespene_gasMini.gif"));

    //		imagesMini [ReferenceObject.OBJECT_REFERENCE_SVC1] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/scv1.gif"));
    //		imagesMini [ReferenceObject.OBJECT_REFERENCE_SVC2] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/scv2.gif"));
    //		
    //		imagesMini [ReferenceObject.OBJECT_REFERENCE_MARINE1] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/marine1.gif"));
    //		imagesMini  [ReferenceObject.OBJECT_REFERENCE_MARINE2] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/marine1.gif"));
    //		
    //		imagesMini [ReferenceObject.OBJECT_REFERENCE_FIREBAT1] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/firebat1.gif"));
    //		imagesMini [ReferenceObject.OBJECT_REFERENCE_FIREBAT2] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/firebat1.gif"));
    //		
    //		imagesMini  [ReferenceObject.OBJECT_REFERENCE_REFINERY1] =  ImageIO.read(new File("C:/JavaEclipse/Tesis/StarcraftTryGame/images/refinery.gif"));

    imagesMini[ReferenceObject.OBJECT_REFERENCE_TABLE] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/mesa.gif"));
    imagesMini[ReferenceObject.OBJECT_REFERENCE_SWORD] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/espadaMini.gif"));

    imagesMini[ReferenceObject.OBJECT_REFERENCE_TRASNPORT] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/transportador.gif"));
    imagesMini[ReferenceObject.OBJECT_REFERENCE_TRASNPORT1] = ImageIO.read(ClassLoader
        .getSystemResourceAsStream("images/transportador.gif"));

  }
}
